package offertest.test01;

/**
 * @ClassName MyThread
 * @Description
 * @Author ZJX
 * @Date 2025/4/7 20:55
 * @Version 1.0
 **/
public class MyThread01 extends Thread{

    static int count = 1000;

    @Override
    public void run() {
        while (count > 0) {
            synchronized (MyThread01.class){
                if (count == 0){
                    break;
                }
                System.out.println(Thread.currentThread().getName()+"获取到第"+count+"个数字");
                count--;
            }
        }

    }
}
